//----------------------------------------------------------------------------
// M A R I T I M E  R E S E A R C H  I N S T I T U T E  N E T H E R L A N D S
//----------------------------------------------------------------------------
// Copyright (C) 2009 - MARIN - All rights reserved - http://www.marin.nl
//----------------------------------------------------------------------------
// Program    : mermaid
// Module     : vbm
// File       : defines.h
//----------------------------------------------------------------------------

#ifndef MATVEC_H
#define MATVEC_H
# include <stdlib.h>
# include <stdio.h>
#include <iostream>
#include <omp.h>
#include "Array2D.h"
#include "defines.h"
#include <vector>
#include "Timer.h"
#include <math.h>

//#define num_p 8


/// matrix vector product
Array2D<REAL> matvec(const std::vector<Array2D<REAL> > &A, const Array2D<REAL> &X);

// Adds the two vectors and returns the result
Array2D<REAL> MatAdd(const Array2D<REAL> &Vec1, const Array2D<REAL> &Vec2);


Array2D<REAL> MatSub(const Array2D<REAL> &Vec1, const Array2D<REAL> &Vec2);


Array2D<REAL> scalarmult(const REAL &mult, const Array2D<REAL> &Vec);

REAL dotproduct(const Array2D<REAL> &Vec1, const Array2D<REAL> &Vec2);
REAL norm(const Array2D<REAL> &Vec1,const Array2D<REAL> &Vec2);
REAL norm(const Array2D<REAL> &Vec1);
void neumannBoundary(Array2D<double> *m_vec, int Nx1, int Nx2);
void constructMatrix(int Nx1, int Nx2, REAL coeff_x, REAL coeff_y, REAL coeff_center, std::vector<Array2D<REAL> > &mat );




#endif // DEFINES_H

